<template>
    <div>
        <van-nav-bar
  title="标题"
  left-text="返回"
  left-arrow
  @click-left="onClickLeft"
  fixed
/>
<div style="height: 45px;"></div>
<div v-html="detailApiData.goods_introduce"></div>
<van-action-bar>
  <van-action-bar-icon icon="chat-o" text="客服" dot />
  <van-action-bar-icon icon="cart-o" text="购物车"  />
  <van-action-bar-icon icon="shop-o" text="店铺" badge="12" />
  <van-action-bar-button type="warning" text="加入购物车" @click="gwc"/>
  <van-action-bar-button type="danger" text="立即购买" />
</van-action-bar>
<!-- :badge="store.piniaCart.length" -->
    </div>
</template>

<script setup>
import router from '@/router';
 const onClickLeft = () => history.back();
import { ref } from 'vue';
import { detailApi } from '@/api/api';
import { useRoute } from 'vue-router';
let route=useRoute()
let detailApiData=ref([])
detailApi(route.params.goods_id).then(res=>{
    detailApiData.value=res.data.message
    console.log(res);
    
})
import { useCounterStore } from '@/stores/cart'
// 在组件内部的任何地方均可以访问变量 `store` ✨
const store = useCounterStore()
const gwc=()=>{
    store.piniaCart=store.piniaCart.filter( detailApiData.value,route.params.goods_id)    
    router.push('/home/carc')
}

</script>

<style lang="scss" scoped>

</style>